package controllers

import (
	"github.com/gin-gonic/gin"
	"go_anime_picture_api/models/response"
	"go_anime_picture_api/services"
	"net/http"
)

const Passwd = "1103"

func RebuildPicInfos(context *gin.Context) {

	passwd, b := context.GetQuery("passwd")
	if b == false || passwd != Passwd {
		context.JSON(http.StatusOK, response.PasswdErrorR)
	} else {
		services.RebuildPicInfos()
		context.JSON(http.StatusOK, response.SuccessR("重构成功！"))
	}

}
